package com.heima.a07_demo.server.controller;

import com.heima.a07_demo.server.service.DeepLearningService;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

@RestController
public class DeepLearningController {
    private final DeepLearningService deepLearningService;

    public DeepLearningController(DeepLearningService deepLearningService) {
        this.deepLearningService = deepLearningService;
    }

    /*
    * 用于测试与深度模型联调是否成功的接口，不用管这个
    * */
    @PostMapping("/testDeepLearning")
    public Map<String, Object> testDeepLearning(@RequestBody Map<String, String> request) {
        String imagePath = request.get("imagePath");
        return deepLearningService.callDeepLearning(imagePath);
    }
}